<?php
/**
 * Created by PhpStorm.
 * User: kkw
 * Date: 2019/1/27
 * Time: 17:41
 */
namespace kkw\user\table;

use suda\archive\Table;

class UserTable extends  Table
{
    public function __construct()
    {
        parent::__construct('user');
    }

    protected function onBuildCreator($table)
    {
        return $table->fields([
            $table->field('id', 'bigint', 20)->primary()->unsigned()->auto(),
            $table->field('name', 'varchar', 255)->unique()->default(null)->comment("用户名"),
            $table->field('mobile', 'varchar', 255)->unique()->default(null)->comment("手机号"),
            $table->field('password', 'varchar', 60)->default(null)->comment("密码"),
            $table->field('type', 'tinyint', 1)->key()->comment("用户类型"),
            $table->field('token', 'varchar', 32)->comment("token"),
            $table->field('status', 'tinyint', 1)->key()->comment("用户状态"),
        ]);
    }
}